package com.troyhigh.njrotc.admintracker;

import java.util.ArrayList;

/**
 * An interface to define the basic functions of a Database.
 * 
 * @author Quan Nguyen
 * @version 2008-December-21
 */
public interface Database
{
    /* There's something to know about the difference between committ and set.
     * The Database should maintain its own copy of the data while it's loaded.
     * The AdminTracker class should never store its own copy of the data.
     * All AdminTracker operations will copy this database, modify it, and 
     * put it back in. Effectively, each command that messes with the database
     * will start with get and end with a set. Commit will "save" the database's
     * internal copy to the medium specified by the class. This could be to
     * SQL, TXT, or XML.
    */
    public void connect();
    public boolean isConnected();
    public void commit();
    public void disconnect();
    
    public boolean isAutoCommit();
    public void setAutoCommit(boolean auto);
    
    public boolean canBackup();
    public void backup();
    public void restore(String filename);
    
    public ArrayList<Cadet> getCadets(); 
    public ArrayList<Event> getEvents();
    
    public void setCadets(ArrayList<Cadet> cadets);
    public void setEvents(ArrayList<Event> events);
}